<cfcomponent extends="base">

<cffunction name="GET" returntype="any" access="public">

<cfinvoke component="data" method="get_roles" returnvariable="get_roles">

<cfinvoke component="base" method="build_sub_admin_nav" returnvariable="build_sub_admin_nav" calling_cfc="Admin Profile">
<div>&nbsp;</div>
<table cellpadding="0" cellspacing="0" border="0" width="99%">
<tr>

<td valign="top" align="left" >

<input type="hidden" name="hold_user" id="hold_user" value="<cfoutput>#get_roles.username#</cfoutput>">
<input type="hidden" name="hold_password" id="hold_password" value="<cfoutput>#get_roles.passcode#</cfoutput>">
<input type="hidden" name="hold_email" id="hold_email" value="<cfoutput>#get_roles.email#</cfoutput>">

<div id="user_area"> </div>

</td>

<td align="center">
<span id="cart_bottom" >
<span id="add_span"><a id="add_new_user" class="pointer" style="text-decoration:underline; font-size:10px; color:#0000FF;"><img src="/images/system-users_small.png" border="0" alt="" align="absmiddle" /><strong>Add New User</strong></a></span>
</span>
<div class="table_top"style="text-align:center;">
<span class="title_panel" >NIPD Users<span id="userhead_loading" class="loading"></span></span><br>
</div>
<div class="table_content">
<div class="table_text" id="shopping_cart" style="font-size:12px;">

</div>
</div>
<div class="table_bottom">
<img src="/images/table_bottom.jpg" width="204" height="23" border="0" alt="" />
</div>
<br>
</td>


</tr>

</table>

</cffunction>

<cffunction name="POST" returntype="any" access="public">
<cfset Var_password = "">
<cfset tmp = "">
<cfset tmp2 = "">

<cfif form.new_password neq "" and form.new_password2 neq "">
	<cfif form.new_password eq form.new_password2>
	<cfset Var_password = "#form.new_password#">
	<cfquery name="insert" datasource="#session.dsn#">
	update prac_roles 
	set 
	username = '#form.user_name#',
	password = '#Var_password#',
	email = '#form.email#'
	where username = '#session.username#'
	</cfquery>
	<cflocation url="#cgi.HTTP_REFERER#?error=0" addtoken="no">
	<cfelse>
	<cflocation url="#cgi.HTTP_REFERER#?error=1" addtoken="no">
	</cfif>
<cfelse>
	<cfquery name="insert" datasource="#session.dsn#">
	update prac_roles 
	set 
	username = '#form.user_name#',
	email = '#form.email#'
	where username = '#session.username#'
	</cfquery>
	<cflocation url="#cgi.HTTP_REFERER#?error=0" addtoken="no">
</cfif>




</cffunction>

</cfcomponent>